
cmake_minimum_required(VERSION 3.4.1)

#C 的编译选项是 CMAKE_C_FLAGS
# 指定编译参数，可选
#SET(CMAKE_C_FLAGS "-DCCORERELEASE")
#SET(CMAKE_CXX_FLAGS "-DCCORERELEASE")


#设置生成的so动态库最后输出的路径
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI})

#设置头文件搜索路径（和此txt同个路径的头文件无需设置），可选
#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common)

#设置生成的so动态库最后输出的路径
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI})

add_library(
             ccore

             SHARED

             src/main/cpp/native-lib.cpp )

#find_library命令是找到log-lib这个库
find_library(
              log-lib

              log )

#指定用到的系统库或者NDK库或者第三方库的搜索路径，可选。
#LINK_DIRECTORIES(/usr/local/lib)


# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
                       ccore

                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib} )



#编译选项
#CMAKE_C_FLAGS
#CMAKE_CXX_FLAGS
#CMAKE_CXX_FLAGS_DEBUG/CMAKE_CXX_FLAGS_RELEASE